﻿CREATE TABLE [dbo].[RoleMembership]
(
	[Id] [dbo].[Id] NOT NULL  IDENTITY(1000000000, 1), 
    [RoleId] [dbo].[Id] NOT NULL, 
    [UserAccountId] [dbo].[Id] NOT NULL, 
    [CreateId] [dbo].[Name] NOT NULL , 
    [CreateDateTime] [dbo].[CreateModifiedDateTime] NOT NULL , 
    [ModifiedId] [dbo].[Name] NOT NULL , 
    [ModifiedDateTime] [dbo].[CreateModifiedDateTime] NOT NULL , 
    CONSTRAINT [PK_RoleMembership] PRIMARY KEY (Id), 
    CONSTRAINT [AK_RoleMembership_RoleId_MembershipId] UNIQUE (RoleId, [UserAccountId]), 
    CONSTRAINT [FK_RoleMembership_Role_RoleId] FOREIGN KEY (RoleId) REFERENCES Role(Id), 
    CONSTRAINT [FK_RoleMembership_UserAccount_UserAccountId] FOREIGN KEY ([UserAccountId]) REFERENCES [UserAccount](Id)
)
